//
//  focusButton.m
//  SoundPill
//
//  Created by 宋鹏鹏 on 15/5/20.
//  Copyright (c) 2015年 宋旭东. All rights reserved.
//

#import "focusButton.h"

@implementation focusButton

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 1.文字颜色
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        
        // 2.设置图标
        // [self setImage:[UIImage imageNamed:@"ic_arrow_down.png"] forState:UIControlStateNormal];
        self.backgroundColor = [UIColor grayColor];
        self.imageView.contentMode = UIViewContentModeScaleAspectFit;
        
        
    }
    return self;
}


- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat h = contentRect.size.height;
    CGFloat w = contentRect.size.width * 0.5;
    return CGRectMake(contentRect.size.width * 0.37, 0, w, h);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat h = contentRect.size.height*0.5;
    CGFloat w = contentRect.size.width * 0.15;
    
    return CGRectMake(contentRect.size.width * 0.1,contentRect.size.height*0.25, w, h);
}

@end
